package org.nowcoder.huawei.c100;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;

/**
 * 62:最长的指定瑕疵度的元音子串
 */
public class HC062 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String s = br.readLine();
        System.out.println(solve(s, n));
    }

    public static int solve(String s, int n) {
        List<Character> alphs = Arrays.asList('A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u');
        int len = s.length();
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < len; i++) {
            char l = s.charAt(i);
            if (alphs.contains(l)) { //开始是元音字母
                int count = 0; //辅音字母个数
                for (int j = i + 1; j < len; j++) {
                    char r = s.charAt(j);
                    if (alphs.contains(r)) {
                        System.out.println(count);
                        if (n == count) {
                            max = Math.max(max, j - i + 1);
                        }
                    } else {
                        count++;
                    }
                }
            }
        }
        return max;
    }
}
